#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <vector>

using namespace std;

int numDecodings(string s) {
    int dp[110] = { 0 };

    if (s[0] != '0')
        dp[1] = 1;

    for (int i = 2; i <= s.size();i++)
    {
        if (s[i - 1] != '0')
            dp[i] = dp[i - 1];

        int target = (s[i - 2] - '0') * 10 + (s[i - 1] - '0');

        if (target >= 10 && target <= 26)
            dp[i] += 1;
    }

    return dp[s.size()];

}

int main()
{
    numDecodings("12");
	return 0;
}